﻿using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;

namespace Workflow_Core_API.Persisted
{
    /// <summary>
    /// 流程定义/模板
    /// </summary>
    [Table("WorkflowDefinition")]
    public class PersistedWorkflowDefinition
    {
        /// <summary>
        /// 主键
        /// </summary>
        public Guid Id { get; set; }

        /// <summary>
        /// 流程标题/描述
        /// </summary>
        [MaxLength(200)]
        public string Title { get; set; }

        public int Version { get; set; }

        /// <summary>
        /// 工作流定义ID
        /// </summary>
        [MaxLength(100)]
        public string WorkflowDefinitionId { get; set; }

        /// <summary>
        /// 流程步骤之间数据传递数据类型
        /// </summary>
        [MaxLength(500)]
        public string DataType { get; set; }
        /// <summary>
        /// 工作流需要执行的步骤
        /// </summary>

        [Column(TypeName = "json")]
        public string StepNodes { get; set; }

        /// <summary>
        /// 是否最新版本
        /// </summary>
        public bool IsLastVersion { get; set; }

        /// <summary>
        /// 当流程执行结束后，要调用的回调地址
        /// </summary>
        [MaxLength(500)]
        public string? CallbackUrl { get; set; }
    }

}
